London | 26-ITP-January | Karla Grajales | Sprint 3 | 1-implement-and-rewrite-tests#1036
London | 26-ITP-January | Karla Grajales | Sprint 3 | 1-implement-and-rewrite-tests#1036Grajales-K wants to merge 16 commits intoCodeYourFuture:mainfrom
Conversation
…ub.com> Co-authored-by: Angela McLeary <AngelaMcLeary@users.noreply.github.com> Co-authored-by: Mohsen Zamanist<https://github.com/mohsenzamanist>
This comment has been minimized.
This comment has been minimized.
3 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
4 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
illicitonion
left a comment
There was a problem hiding this comment.
This is generally looking really good, well done!
On your question:
Hi, I have a question regarding the testing strategy. When and why is it better to implement manual assertions versus using a framework like Jest? Are there specific rules or industry standards on when to use each approach?
In real life, we almost always use a testing framework - they tend to have lots of convenience things (e.g. as you've seen here expect(...).toThrow(...) is much more convenient to write than having to do a try-catch and failing the test in the try after the code you're testing - you can build these things up yourself, but frameworks exist to do this for you :)
Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js
Outdated
Show resolved
Hide resolved
Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js
Outdated
Show resolved
Hide resolved
Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js
Outdated
Show resolved
Hide resolved
Hi @illicitonion, that makes a lot of sense. Building manual assertions was a great exercise to understand how testing works under the hood, but I can see how Thank you very much for your time. |
Learners, PR Template
Self checklist
Changelist
In this project, I learned how to implement functions and write comprehensive test cases using assertions and error handling (throw). I also practiced using helper functions to improve test readability and finally transitioned to Jest by exporting the logic as a module.
Questions
Hi, I have a question regarding the testing strategy. When and why is it better to implement manual assertions versus using a framework like Jest? Are there specific rules or industry standards on when to use each approach?
Thank you.